package com.sanjiahantang.youjiarole.module.login.views.impl;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.sanjiahantang.youjiarole.R;
import com.sanjiahantang.youjiarole.base.BaseMvpActivity;
import com.sanjiahantang.youjiarole.config.ConfigValue;
import com.sanjiahantang.youjiarole.config.SPConfig;
import com.sanjiahantang.youjiarole.module.common.views.impl.MainActivity;
import com.sanjiahantang.youjiarole.module.decorate.views.impl.DecorateActivity;
import com.sanjiahantang.youjiarole.module.join.views.impl.CertificationActivity;
import com.sanjiahantang.youjiarole.module.login.presenters.LoginPresenter;
import com.sanjiahantang.youjiarole.module.login.views.LoginView;
import com.sanjiahantang.youjiarole.utils.SPUtils;


/**
 * Created by zy on 2017/10/23.
 */

public class RegisterSuccessActivity extends BaseMvpActivity<LoginView, LoginPresenter> implements LoginView, View.OnClickListener {
    TextView tv_cmitForm, txtToMain;

    private String token,phone;
    @Override
    public void showProgress() {
        super.showProgress($this);
    }

    @Override
    public LoginPresenter initPresenter() {
        return new LoginPresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.activity_register_success);
        findViewById(R.id.btnLogin).setOnClickListener(this);
        token = getIntent().getStringExtra(KEY_TOKEN);
        phone = getIntent().getStringExtra(KEY_PHONE);
        txtToMain = (TextView) findViewById(R.id.txtToMain);
        txtToMain.setOnClickListener(this);

    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btnLogin:
                Intent intent = new Intent(this, CertificationActivity.class);
                intent.putExtra(KEY_TOKEN,token);
                intent.putExtra(KEY_PHONE,phone);
                startActivity(intent);
                finish();
                break;
            case R.id.txtToMain:
                startActivity(new Intent($this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP ));
                break;
        }

    }
}
